package br.com.agiledev.webscrum.eao;

import java.util.List;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;

import br.com.agiledev.webscrum.entity.User;

@Name("userEAO")
@Scope(ScopeType.APPLICATION)
@AutoCreate
public class UserEAO extends BaseEAO<User> {

    @SuppressWarnings("unchecked")
    public List<User> porLoginOuNome(String valor) {

	return getEntityManager().createNamedQuery("User.porLoginOuNome").setParameter("valor",
		valor.toLowerCase() + "%").getResultList();
    }

}
